home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.1 / pbmmask.1 < prev    next >
Text File  |  1995-07-25  |  3KB  |  67 lines

  1.  
  2.  
  3.  
  4.      ppppbbbbmmmmmmmmaaaasssskkkk((((1111))))       XXXXEEEENNNNIIIIXXXX SSSSyyyysssstttteeeemmmm VVVV ((((00008888 AAAAuuuugggguuuusssstttt 1111999988889999))))       ppppbbbbmmmmmmmmaaaasssskkkk((((1111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           pbmmask - create a mask bitmap from a regular bitmap
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           ppppbbbbmmmmmmmmaaaasssskkkk [----eeeexxxxppppaaaannnndddd] [_p_b_m_f_i_l_e]
  13.  
  14.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  15.           Reads a portable bitmap as input.  Creates a corresponding
  16.           mask bitmap and writes it out.
  17.  
  18.           The color to be interpreted as "background" is determined
  19.           automatically.  Regardless of which color is background, the
  20.           mask will be white where the background is and black where
  21.           the figure is.
  22.  
  23.           This lets you do a masked paste like this, for objects with
  24.           a black background:
  25.               pbmmask obj > objmask
  26.               pnmpaste < dest -and objmask <x> <y> | pnmpaste -or obj <x> <y>
  27.           For objects with a white background, you can either invert
  28.           them or add a step:
  29.               pbmmask obj > objmask
  30.               pnminvert objmask | pnmpaste -and obj 0 0 > blackback
  31.               pnmpaste < dest -and objmask <x> <y> | pnmpaste -or blackback <x> <y>
  32.           Note that this three-step version works for objects with
  33.           black backgrounds too, if you don't care about the wasted
  34.           time.
  35.  
  36.           You can also use masks with graymaps and pixmaps, using the
  37.           _p_n_m_a_r_i_t_h tool.  For instance:
  38.               ppmtopgm obj.ppm | pgmtopbm -threshold | pbmmask > objmask.pbm
  39.               pnmarith -multiply dest.ppm objmask.pbm > t1.ppm
  40.               pnminvert objmask.pbm | pnmarith -multiply obj.ppm - > t2.ppm
  41.               pnmarith -add t1.ppm t2.ppm
  42.           An interesting variation on this is to pipe the mask through
  43.           the _p_n_m_s_m_o_o_t_h script before using it.  This makes the
  44.           boundary between the two images less sharp.
  45.  
  46.           ----eeeexxxxppppaaaannnndddd
  47.                Expands the mask by one pixel out from the image.  This
  48.                is useful if you want a little white border around your
  49.                image.  (A better solution might be to turn the _p_b_m_l_i_f_e
  50.                tool into a general cellular automaton tool...)
  51.  
  52.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  53.           pnmpaste(1), pnminvert(1), pbm(5), pnmarith(1), pnmsmooth(1)
  54.  
  55.      AAAAUUUUTTTTHHHHOOOORRRR
  56.           Copyright (C) 1988 by Jef Poskanzer.
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                                           (printed 9/7/93)
  64.  
  65.  
  66.  
  67.